<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  <meta name="google-site-verification" content="XKEVBvaS3n3qpVoP-hQqQ2XJ9t43pt4B7J1sLZgRJG4" />
  
  
  <title>问题定位 | Peronca Xtrabackup 8.0近日踩坑总结 - xtrabackup 2.4和8.0区别 | DBKernel - 专注于分享数据库技术</title>
  <meta name="description" content="本文首发于 2020-08-27 13:46:15  前言近期在给 radondb&#x2F;xenon 适配 percona xtrabackup 8.0时，遇到了一些问题，经过多日调研、尝试终于解决，特此分享。 版本信息： 12Percona-Server 8.0.19-10Percona-Xtrabackup 8.0.13  版本各字段含义参考 https:&#x2F;&#x2F;www.percona.com&#x2F;">
<meta property="og:type" content="article">
<meta property="og:title" content="问题定位 | Peronca Xtrabackup 8.0近日踩坑总结 - xtrabackup 2.4和8.0区别">
<meta property="og:url" content="http://dbkernel.github.io/2020/08/27/percona-xtrabackup-2.4-vs-8.0/index.html">
<meta property="og:site_name" content="DBKernel">
<meta property="og:description" content="本文首发于 2020-08-27 13:46:15  前言近期在给 radondb&#x2F;xenon 适配 percona xtrabackup 8.0时，遇到了一些问题，经过多日调研、尝试终于解决，特此分享。 版本信息： 12Percona-Server 8.0.19-10Percona-Xtrabackup 8.0.13  版本各字段含义参考 https:&#x2F;&#x2F;www.percona.com&#x2F;">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://dbkernel-1306518848.cos.ap-beijing.myqcloud.com/wechat/my-wechat-official-account.png">
<meta property="article:published_time" content="2020-08-27T05:46:15.000Z">
<meta property="article:modified_time" content="2021-09-24T04:11:55.890Z">
<meta property="article:author" content="DBKernel">
<meta property="article:tag" content="MySQL">
<meta property="article:tag" content="问题定位">
<meta property="article:tag" content="Percona">
<meta property="article:tag" content="Xtrabackup">
<meta property="article:tag" content="RadonDB">
<meta property="article:tag" content="Xenon">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://dbkernel-1306518848.cos.ap-beijing.myqcloud.com/wechat/my-wechat-official-account.png">
  <!-- Canonical links -->
  <link rel="canonical" href="http://dbkernel.github.io/2020/08/27/percona-xtrabackup-2.4-vs-8.0/index.html">
  
    <link rel="alternate" href="/atom.xml" title="DBKernel" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png" type="image/x-icon">
  
  
<link rel="stylesheet" href="../../../../css/style.css">

  
  
  
  
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1.4.0/dist/gitalk.min.css">
  
<meta name="generator" content="Hexo 5.4.0"></head>


<body class="main-center" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://github.com/dbkernel" target="_blank">
          <img class="img-circle img-rotate" src="../../../../images/avatar.png" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">DBKernel</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">资深数据库开发工程师</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Beijing, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="../../../../.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">首页</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="../../../../archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">归档</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="../../../../categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">分类</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="../../../../tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">标签</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="../../../../repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">项目</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-links">
          <a href="../../../../links">
            
            <i class="icon icon-friendship"></i>
            
            <span class="menu-title">友链</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-about">
          <a href="../../../../about">
            
            <i class="icon icon-cup-fill"></i>
            
            <span class="menu-title">关于</span>
          </a>
        </li>
        
      </ul>
      
	
    <ul class="social-links">
    	
        <li><a href="../../../../https:/github.com/dbkernel" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="../../../../atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>本站专注于分享关系型数据库及分布式数据库相关技术！如需深入交流，可添加我的微信或关注我的公众号数据库内核：</br><img src="/images/wechat-me.jpeg" width="130" height="130"/> <img src="/images/wechat-gzh.jpeg" width="130" height="130"/></p>
            </div>
        </div>
    </div>
</div>

    
      
  <div class="widget">
    <h3 class="widget-title">分类</h3>
    <div class="widget-body">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="../../../../categories/ClickHouse/">ClickHouse</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/C%E8%AF%AD%E8%A8%80/">C语言</a><span class="category-list-count">8</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/GreenPlum/">GreenPlum</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/Linux/">Linux</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/MySQL/">MySQL</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/PostgreSQL/">PostgreSQL</a><span class="category-list-count">7</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/Postgres-X2/">Postgres-X2</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/%E7%BC%96%E8%AF%91%E8%B0%83%E8%AF%95/">编译调试</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/%E9%80%9A%E7%94%A8/">通用</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/APUE/" rel="tag">APUE</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/B-Tree/" rel="tag">B-Tree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ClickHouse/" rel="tag">ClickHouse</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ClickHouse%E5%92%8C%E4%BB%96%E7%9A%84%E6%9C%8B%E5%8F%8B%E4%BB%AC/" rel="tag">ClickHouse和他的朋友们</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Count/" rel="tag">Count</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/C%E8%AF%AD%E8%A8%80/" rel="tag">C语言</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/DAG-Scheduler/" rel="tag">DAG Scheduler</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/GreenPlum/" rel="tag">GreenPlum</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/HEAP%E5%BC%95%E6%93%8E/" rel="tag">HEAP引擎</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/LICENCE/" rel="tag">LICENCE</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/LSM-Tree/" rel="tag">LSM-Tree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Linux/" rel="tag">Linux</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MEMORY%E5%BC%95%E6%93%8E/" rel="tag">MEMORY引擎</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Makefile/" rel="tag">Makefile</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Materialized-View/" rel="tag">Materialized View</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MergeTree/" rel="tag">MergeTree</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MySQL/" rel="tag">MySQL</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Parser/" rel="tag">Parser</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Percona/" rel="tag">Percona</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/PostgreSQL/" rel="tag">PostgreSQL</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Postgres-X2/" rel="tag">Postgres-X2</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Postgres-XC/" rel="tag">Postgres-XC</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/RadonDB/" rel="tag">RadonDB</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ReplicatedMergeTree/" rel="tag">ReplicatedMergeTree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Select/" rel="tag">Select</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/UNIX/" rel="tag">UNIX</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/WAL/" rel="tag">WAL</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Xenon/" rel="tag">Xenon</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Xtrabackup/" rel="tag">Xtrabackup</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/auto-increment/" rel="tag">auto_increment</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/crontab/" rel="tag">crontab</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/daemon/" rel="tag">daemon</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/df/" rel="tag">df</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/du/" rel="tag">du</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/gcc/" rel="tag">gcc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/gcov/" rel="tag">gcov</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/getopt/" rel="tag">getopt</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/github/" rel="tag">github</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/group-by/" rel="tag">group by</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/lcov/" rel="tag">lcov</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/libpq/" rel="tag">libpq</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pg-constraint/" rel="tag">pg_constraint</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pg-depend/" rel="tag">pg_depend</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pgbench/" rel="tag">pgbench</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pipeline/" rel="tag">pipeline</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/processor/" rel="tag">processor</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/shell/" rel="tag">shell</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5/" rel="tag">主从同步</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E4%BC%98%E5%8C%96%E5%99%A8/" rel="tag">优化器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D/" rel="tag">内存分配</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86/" rel="tag">内存管理</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95/" rel="tag">回归测试</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%97%E8%8A%82%E5%AF%B9%E9%BD%90/" rel="tag">字节对齐</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%97%E8%8A%82%E5%BA%8F/" rel="tag">字节序</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%98%E5%82%A8%E8%AE%A1%E7%AE%97%E5%88%86%E7%A6%BB/" rel="tag">存储计算分离</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%B9%B6%E8%A1%8C%E6%9F%A5%E8%AF%A2/" rel="tag">并行查询</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE/" rel="tag">开源协议</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E8%AF%81/" rel="tag">开源许可证</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%9C%AC%E5%9C%B0%E4%BA%8B%E5%8A%A1/" rel="tag">本地事务</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%B5%8B%E8%AF%95/" rel="tag">测试</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/" rel="tag">源码分析</a><span class="tag-list-count">15</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/" rel="tag">系统运维</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BC%96%E8%AF%91%E5%99%A8/" rel="tag">编译器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BD%91%E7%BB%9C%E5%BA%8F/" rel="tag">网络序</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" rel="tag">网络编程</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D/" rel="tag">问题定位</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="../../../../tags/APUE/" style="font-size: 13.33px;">APUE</a> <a href="../../../../tags/B-Tree/" style="font-size: 13px;">B-Tree</a> <a href="../../../../tags/ClickHouse/" style="font-size: 13.89px;">ClickHouse</a> <a href="../../../../tags/ClickHouse%E5%92%8C%E4%BB%96%E7%9A%84%E6%9C%8B%E5%8F%8B%E4%BB%AC/" style="font-size: 13.89px;">ClickHouse和他的朋友们</a> <a href="../../../../tags/Count/" style="font-size: 13px;">Count</a> <a href="../../../../tags/C%E8%AF%AD%E8%A8%80/" style="font-size: 13.67px;">C语言</a> <a href="../../../../tags/DAG-Scheduler/" style="font-size: 13px;">DAG Scheduler</a> <a href="../../../../tags/GreenPlum/" style="font-size: 13.22px;">GreenPlum</a> <a href="../../../../tags/HEAP%E5%BC%95%E6%93%8E/" style="font-size: 13px;">HEAP引擎</a> <a href="../../../../tags/LICENCE/" style="font-size: 13px;">LICENCE</a> <a href="../../../../tags/LSM-Tree/" style="font-size: 13px;">LSM-Tree</a> <a href="../../../../tags/Linux/" style="font-size: 13.44px;">Linux</a> <a href="../../../../tags/MEMORY%E5%BC%95%E6%93%8E/" style="font-size: 13px;">MEMORY引擎</a> <a href="../../../../tags/Makefile/" style="font-size: 13px;">Makefile</a> <a href="../../../../tags/Materialized-View/" style="font-size: 13px;">Materialized View</a> <a href="../../../../tags/MergeTree/" style="font-size: 13.11px;">MergeTree</a> <a href="../../../../tags/MySQL/" style="font-size: 13.56px;">MySQL</a> <a href="../../../../tags/Parser/" style="font-size: 13px;">Parser</a> <a href="../../../../tags/Percona/" style="font-size: 13px;">Percona</a> <a href="../../../../tags/PostgreSQL/" style="font-size: 13.78px;">PostgreSQL</a> <a href="../../../../tags/Postgres-X2/" style="font-size: 13px;">Postgres-X2</a> <a href="../../../../tags/Postgres-XC/" style="font-size: 13px;">Postgres-XC</a> <a href="../../../../tags/RadonDB/" style="font-size: 13px;">RadonDB</a> <a href="../../../../tags/ReplicatedMergeTree/" style="font-size: 13px;">ReplicatedMergeTree</a> <a href="../../../../tags/Select/" style="font-size: 13px;">Select</a> <a href="../../../../tags/UNIX/" style="font-size: 13.22px;">UNIX</a> <a href="../../../../tags/WAL/" style="font-size: 13.11px;">WAL</a> <a href="../../../../tags/Xenon/" style="font-size: 13px;">Xenon</a> <a href="../../../../tags/Xtrabackup/" style="font-size: 13px;">Xtrabackup</a> <a href="../../../../tags/auto-increment/" style="font-size: 13px;">auto_increment</a> <a href="../../../../tags/crontab/" style="font-size: 13px;">crontab</a> <a href="../../../../tags/daemon/" style="font-size: 13px;">daemon</a> <a href="../../../../tags/df/" style="font-size: 13px;">df</a> <a href="../../../../tags/du/" style="font-size: 13px;">du</a> <a href="../../../../tags/gcc/" style="font-size: 13px;">gcc</a> <a href="../../../../tags/gcov/" style="font-size: 13px;">gcov</a> <a href="../../../../tags/getopt/" style="font-size: 13px;">getopt</a> <a href="../../../../tags/github/" style="font-size: 13px;">github</a> <a href="../../../../tags/group-by/" style="font-size: 13px;">group by</a> <a href="../../../../tags/lcov/" style="font-size: 13px;">lcov</a> <a href="../../../../tags/libpq/" style="font-size: 13px;">libpq</a> <a href="../../../../tags/pg-constraint/" style="font-size: 13px;">pg_constraint</a> <a href="../../../../tags/pg-depend/" style="font-size: 13px;">pg_depend</a> <a href="../../../../tags/pgbench/" style="font-size: 13px;">pgbench</a> <a href="../../../../tags/pipeline/" style="font-size: 13px;">pipeline</a> <a href="../../../../tags/processor/" style="font-size: 13px;">processor</a> <a href="../../../../tags/shell/" style="font-size: 13px;">shell</a> <a href="../../../../tags/%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5/" style="font-size: 13.11px;">主从同步</a> <a href="../../../../tags/%E4%BC%98%E5%8C%96%E5%99%A8/" style="font-size: 13px;">优化器</a> <a href="../../../../tags/%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D/" style="font-size: 13px;">内存分配</a> <a href="../../../../tags/%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86/" style="font-size: 13px;">内存管理</a> <a href="../../../../tags/%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95/" style="font-size: 13px;">回归测试</a> <a href="../../../../tags/%E5%AD%97%E8%8A%82%E5%AF%B9%E9%BD%90/" style="font-size: 13.11px;">字节对齐</a> <a href="../../../../tags/%E5%AD%97%E8%8A%82%E5%BA%8F/" style="font-size: 13.11px;">字节序</a> <a href="../../../../tags/%E5%AD%98%E5%82%A8%E8%AE%A1%E7%AE%97%E5%88%86%E7%A6%BB/" style="font-size: 13px;">存储计算分离</a> <a href="../../../../tags/%E5%B9%B6%E8%A1%8C%E6%9F%A5%E8%AF%A2/" style="font-size: 13px;">并行查询</a> <a href="../../../../tags/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE/" style="font-size: 13px;">开源协议</a> <a href="../../../../tags/%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E8%AF%81/" style="font-size: 13px;">开源许可证</a> <a href="../../../../tags/%E6%9C%AC%E5%9C%B0%E4%BA%8B%E5%8A%A1/" style="font-size: 13px;">本地事务</a> <a href="../../../../tags/%E6%B5%8B%E8%AF%95/" style="font-size: 13px;">测试</a> <a href="../../../../tags/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/" style="font-size: 14px;">源码分析</a> <a href="../../../../tags/%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/" style="font-size: 13px;">系统运维</a> <a href="../../../../tags/%E7%BC%96%E8%AF%91%E5%99%A8/" style="font-size: 13px;">编译器</a> <a href="../../../../tags/%E7%BD%91%E7%BB%9C%E5%BA%8F/" style="font-size: 13.11px;">网络序</a> <a href="../../../../tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" style="font-size: 13px;">网络编程</a> <a href="../../../../tags/%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D/" style="font-size: 13.11px;">问题定位</a>
    </div>
  </div>

    
      
  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/08/">八月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/01/">一月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/09/">九月 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/08/">八月 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/07/">七月 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/06/">六月 2020</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/05/">五月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2019/12/">十二月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2019/04/">四月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2018/09/">九月 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/11/">十一月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/04/">四月 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/03/">三月 2016</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/01/">一月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/12/">十二月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/11/">十一月 2015</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/05/">五月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/01/">一月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/08/">八月 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/07/">七月 2014</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/03/">三月 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/01/">一月 2014</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/%E9%80%9A%E7%94%A8/">通用</a>
              </p>
              <p class="item-title">
                <a href="../../../../2021/08/19/how-to-choose-open-source-licence/" class="title">技术分享 | 如何为你的代码选择一个合适的开源协议？</a>
              </p>
              <p class="item-date">
                <time datetime="2021-08-18T16:37:15.000Z" itemprop="datePublished">2021-08-19</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../../2021/01/26/clickhouse-and-friends-15-groupby/" class="title">源码分析 | ClickHouse和他的朋友们（15）Group By 为什么这么快</a>
              </p>
              <p class="item-date">
                <time datetime="2021-01-26T13:31:12.000Z" itemprop="datePublished">2021-01-26</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../09/21/clickhouse-and-friends-14-compute-storage/" class="title">源码分析 | ClickHouse和他的朋友们（14）存储计算分离方案与实现</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-21T14:01:12.000Z" itemprop="datePublished">2020-09-21</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../09/15/clickhouse-and-friends-13-replicated-merge-tree/" class="title">源码分析 | ClickHouse和他的朋友们（13）ReplicatedMergeTree表引擎及同步机制</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-15T12:15:14.000Z" itemprop="datePublished">2020-09-15</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../09/03/clickhouse-and-friends-12-materialized-view/" class="title">源码分析 | ClickHouse和他的朋友们（12）神奇的物化视图(Materialized View)与原理</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-03T13:22:14.000Z" itemprop="datePublished">2020-09-03</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  
<aside class="sidebar sidebar-toc collapse" id="collapseToc" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    <nav id="toc" class="article-toc">
      <h3 class="toc-title">文章目录</h3>
      <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%80%82%E9%85%8D%E8%BF%87%E7%A8%8B%E4%B8%AD%E9%81%87%E5%88%B0%E7%9A%84%E5%9D%91"><span class="toc-number">2.</span> <span class="toc-text">适配过程中遇到的坑</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#xtrabackup-2-4%E5%92%8C8-0%E5%8C%BA%E5%88%AB"><span class="toc-number">3.</span> <span class="toc-text">xtrabackup 2.4和8.0区别</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D"><span class="toc-number">4.</span> <span class="toc-text">问题定位</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9D%91%E4%B8%80%EF%BC%9AMySQL-8-0-Semi-Sync-%E9%87%8D%E5%BB%BA%E9%97%AE%E9%A2%98"><span class="toc-number">4.1.</span> <span class="toc-text">坑一：MySQL 8.0 + Semi-Sync 重建问题</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9D%91%E4%BA%8C%EF%BC%9AMySQL-8-0-Group-Replication-%E9%87%8D%E5%BB%BA%E5%90%8E%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8MGR"><span class="toc-number">4.2.</span> <span class="toc-text">坑二：MySQL 8.0 + Group-Replication 重建后无法启动MGR</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">5.</span> <span class="toc-text">总结</span></a></li></ol>
    </nav>
  </div>
</aside>

<main class="main" role="main">
  <div class="content">
  <article id="post-percona-xtrabackup-2.4-vs-8.0" class="article article-type-post" itemscope itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      
        
  
    <h1 class="article-title" itemprop="name">
      问题定位 | Peronca Xtrabackup 8.0近日踩坑总结 - xtrabackup 2.4和8.0区别
    </h1>
  

      
      <div class="article-meta">
        <span class="article-date">
    <i class="icon icon-calendar-check"></i>
	<a href="" class="article-date">
	  <time datetime="2020-08-27T05:46:15.000Z" itemprop="datePublished">2020-08-27</time>
	</a>
</span>
        
  <span class="article-category">
    <i class="icon icon-folder"></i>
    <a class="article-category-link" href="../../../../categories/MySQL/">MySQL</a>
  </span>

        
  <span class="article-tag">
    <i class="icon icon-tags"></i>
	<a class="article-tag-link-link" href="../../../../tags/MySQL/" rel="tag">MySQL</a>, <a class="article-tag-link-link" href="../../../../tags/Percona/" rel="tag">Percona</a>, <a class="article-tag-link-link" href="../../../../tags/RadonDB/" rel="tag">RadonDB</a>, <a class="article-tag-link-link" href="../../../../tags/Xenon/" rel="tag">Xenon</a>, <a class="article-tag-link-link" href="../../../../tags/Xtrabackup/" rel="tag">Xtrabackup</a>, <a class="article-tag-link-link" href="../../../../tags/%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D/" rel="tag">问题定位</a>
  </span>


        
	<span class="article-read hidden-xs">
	    <i class="icon icon-eye-fill" aria-hidden="true"></i>
	    <span id="busuanzi_container_page_pv">
			<span id="busuanzi_value_page_pv">0</span>
		</span>
	</span>


        <span class="post-comment"><i class="icon icon-comment"></i> <a href="#comments" class="article-comment-link">评论</a></span>
        
	
		<span class="post-wordcount hidden-xs" itemprop="wordCount">字数统计: 3.3k(字)</span>
	
	
		<span class="post-readcount hidden-xs" itemprop="timeRequired">阅读时长: 17(分)</span>
	

      </div>
    </div>
    <div class="article-entry marked-body" itemprop="articleBody">
      
        <span id="more"></span>


<blockquote>
<p><strong>本文首发于 2020-08-27 13:46:15</strong></p>
</blockquote>
<h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>近期在给 <code>radondb/xenon</code> 适配 percona xtrabackup 8.0时，遇到了一些问题，经过多日调研、尝试终于解决，特此分享。</p>
<p><strong>版本信息：</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Percona-Server 8.0.19-10</span><br><span class="line">Percona-Xtrabackup 8.0.13</span><br></pre></td></tr></table></figure>

<p>版本各字段含义参考 <a target="_blank" rel="noopener" href="https://www.percona.com/blog/2020/08/18/aligning-percona-xtrabackup-versions-with-percona-server-for-mysql/">https://www.percona.com/blog/2020/08/18/aligning-percona-xtrabackup-versions-with-percona-server-for-mysql/</a></p>
<h3 id="适配过程中遇到的坑"><a href="#适配过程中遇到的坑" class="headerlink" title="适配过程中遇到的坑"></a>适配过程中遇到的坑</h3><p>一、MySQL 8.0 + Semi-Sync + 持续写入数据期间执行重建后，change master to &amp;&amp; start slave 报错：</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Last_Error: Could <span class="keyword">not</span> execute Write_rows <span class="keyword">event</span> on <span class="keyword">table</span> db1<span class="variable">.t1</span>; Duplicate entry &#x27;<span class="number">28646</span>&#x27; <span class="keyword">for</span> key &#x27;t1<span class="variable">.PRIMARY</span>&#x27;, Error_code: <span class="number">1062</span>; handler error HA_ERR_FOUND_DUPP_KEY; the <span class="keyword">event</span>&#x27;s master log mysql-bin<span class="variable">.000052</span>, end_log_pos <span class="number">437</span></span><br></pre></td></tr></table></figure>

<p>二、MySQL 8.0 + Group Replication + 持续写入数据期间执行重建后，change master to &amp;&amp; start group_replication 报错：</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">21</span>T14:<span class="number">51</span>:<span class="number">09</span><span class="variable">.977606</span>+<span class="number">08</span>:<span class="number">00</span> <span class="number">61</span> [System] [MY-<span class="number">010597</span>] [Repl] &#x27;CHANGE MASTER TO FOR CHANNEL &#x27;group_replication_applier&#x27; executed&#x27;. Previous state master_host=&#x27;&lt;NULL&gt;&#x27;, master_port= <span class="number">0</span>, master_log_file=&#x27;&#x27;, master_log_pos= <span class="number">4</span>, master_bind=&#x27;&#x27;. New state master_host=&#x27;&lt;NULL&gt;&#x27;, master_port= <span class="number">0</span>, master_log_file=&#x27;&#x27;, master_log_pos= <span class="number">4</span>, master_bind=&#x27;&#x27;.</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">21</span>T14:<span class="number">51</span>:<span class="number">09</span><span class="variable">.987494</span>+<span class="number">08</span>:<span class="number">00</span> <span class="number">61</span> [ERROR] [MY-<span class="number">013124</span>] [Repl] Slave SQL <span class="keyword">for</span> channel &#x27;group_replication_applier&#x27;: Slave failed to initialize relay log info structure from the repository, Error_code: MY-<span class="number">013124</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">21</span>T14:<span class="number">51</span>:<span class="number">09</span><span class="variable">.987542</span>+<span class="number">08</span>:<span class="number">00</span> <span class="number">61</span> [ERROR] [MY-<span class="number">011534</span>] [Repl] Plugin group_replication reported: &#x27;Error <span class="keyword">while</span> starting the group replication applier thread&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">21</span>T14:<span class="number">51</span>:<span class="number">09</span><span class="variable">.987651</span>+<span class="number">08</span>:<span class="number">00</span> <span class="number">7</span> [ERROR] [MY-<span class="number">011669</span>] [Repl] Plugin group_replication reported: &#x27;Unable to initialize the Group Replication applier <span class="keyword">module</span>.&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">21</span>T14:<span class="number">51</span>:<span class="number">09</span><span class="variable">.987831</span>+<span class="number">08</span>:<span class="number">00</span> <span class="number">7</span> [ERROR] [MY-<span class="number">011735</span>] [Repl] Plugin group_replication reported: &#x27;[GCS] The member is leaving a group without being on one.&#x27;</span><br></pre></td></tr></table></figure>

<p>要解释这个问题，首先要弄清楚xtrabackup 2.4和8.0的区别。</p>
<h3 id="xtrabackup-2-4和8-0区别"><a href="#xtrabackup-2-4和8-0区别" class="headerlink" title="xtrabackup 2.4和8.0区别"></a>xtrabackup 2.4和8.0区别</h3><p><strong>google查到xtrabackup 8.0与2.4版本行为有所不同：</strong></p>
<blockquote>
<ol>
<li>Xtrabackup 2.4 备份后生成的 <code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息是准确的，但是备份恢复后 <code>show master status</code> 显示的 GTID 是不准确的。</li>
<li>Xtrabackup 8.0 在备份只有 InnoDB 表的实例时，<code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息不一定是准确的，但是备份恢复后 <code>show master status</code> 显示的 GTID 是准确的。</li>
<li>Xtrabackup 8.0 在备份有非 InnoDB 表格的实例时，<code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息是准确的，备份恢复后 <code>show master status</code> 显示的 GTID 也是准确的。</li>
</ol>
</blockquote>
<p><strong>之前研究过 xtrabackup 2.4 ，其过程大致如下：</strong></p>
<blockquote>
<ol>
<li>start backup</li>
<li>copy ibdata1 / copy .ibd file</li>
<li>excuted FTWRL</li>
<li>backup non-InnoDB tables and files</li>
<li>writing xtrabackup_binlog_info</li>
<li>executed FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS</li>
<li>executed UNLOCK TABLES</li>
<li>copying ib_buffer_pool</li>
<li>completed OK!</li>
</ol>
</blockquote>
<p><strong>问题1：xtrabackup 8.0 的执行过程是什么样？</strong></p>
<p>首先，查看重建期间的<code>general log</code>：</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.136376</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SET SESSION wait_timeout=<span class="number">2147483</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.136439</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SET SESSION autocommit=<span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.136523</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SET NAMES utf8</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.136595</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SHOW VARIABLES</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.138840</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT COUNT(*) FROM information_schema<span class="variable">.tables</span> WHERE engine = &#x27;MyISAM&#x27; OR engine = &#x27;RocksDB&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.140203</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SHOW ENGINES</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.140407</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SHOW ENGINE INNODB STATUS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.141570</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT PLUGIN_NAME, PLUGIN_LIBRARY FROM information_schema<span class="variable">.plugins</span> WHERE PLUGIN_STATUS = &#x27;ACTIVE&#x27; AND PLUGIN_TYPE = &#x27;KEYRING&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.142140</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT  CONCAT(table_schema, &#x27;/&#x27;, table_name), engine FROM information_schema<span class="variable">.tables</span> WHERE engine NOT IN (&#x27;MyISAM&#x27;, &#x27;InnoDB&#x27;, &#x27;CSV&#x27;, &#x27;MRG_MYISAM&#x27;, &#x27;ROCKSDB&#x27;) AND table_schema NOT IN (  &#x27;performance_schema&#x27;, &#x27;information_schema&#x27;,   &#x27;mysql&#x27;)</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.209819</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">171</span> Query	SET SESSION wait_timeout=<span class="number">2147483</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.209879</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">171</span> Query	SET SESSION autocommit=<span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.209950</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">171</span> Query	SET NAMES utf8</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.210015</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">171</span> Query	SHOW VARIABLES</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">18</span><span class="variable">.214030</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT T2<span class="variable">.PATH</span>,        T2<span class="variable">.NAME</span>,        T1<span class="variable">.SPACE_TYPE</span> FROM   INFORMATION_SCHEMA<span class="variable">.INNODB_TABLESPACES</span> T1        JOIN INFORMATION_SCHEMA<span class="variable">.INNODB_TABLESPACES_BRIEF</span> T2 USING (SPACE) WHERE  T1<span class="variable">.SPACE_TYPE</span> = &#x27;Single&#x27; &amp;&amp; T1<span class="variable">.ROW_FORMAT</span> != &#x27;Undo&#x27;UNION SELECT T2<span class="variable">.PATH</span>,        SUBSTRING_INDEX(SUBSTRING_INDEX(T2<span class="variable">.PATH</span>, &#x27;/&#x27;, -<span class="number">1</span>), &#x27;.&#x27;, <span class="number">1</span>) NAME,        T1<span class="variable">.SPACE_TYPE</span> FROM   INFORMATION_SCHEMA <span class="variable">.INNODB_TABLESPACES</span> T1        JOIN INFORMATION_SCHEMA <span class="variable">.INNODB_TABLESPACES_BRIEF</span> T2 USING (SPACE) WHERE  T1<span class="variable">.SPACE_TYPE</span> = &#x27;General&#x27; &amp;&amp; T1<span class="variable">.ROW_FORMAT</span> != &#x27;Undo&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">19</span><span class="variable">.533904</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	FLUSH NO_WRITE_TO_BINLOG BINARY LOGS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">19</span><span class="variable">.543095</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT server_uuid, <span class="keyword">local</span>, replication, storage_engines FROM performance_schema<span class="variable">.log_status</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">19</span><span class="variable">.543418</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SHOW VARIABLES</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">19</span><span class="variable">.545383</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SHOW VARIABLES</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">19</span><span class="variable">.550641</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">20</span><span class="variable">.556885</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT UUID()</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">26</span>T16:<span class="number">20</span>:<span class="number">20</span><span class="variable">.557118</span>+<span class="number">08</span>:<span class="number">00</span>	  <span class="number">170</span> Query	SELECT VERSION()</span><br></pre></td></tr></table></figure>

<p>可见，<strong>xtrabackup 8.0默认情况下大致过程如下：</strong></p>
<blockquote>
<ol>
<li>start backup</li>
<li>copy .ibd file</li>
<li>backup non-InnoDB tables and files</li>
<li>executed FLUSH NO_WRITE_TO_BINLOG BINARY LOGS</li>
<li>selecting LSN and binary log position from p_s.log_status</li>
<li>copy last binlog file</li>
<li>writing /mysql/backup/backup/binlog.index</li>
<li>writing xtrabackup_binlog_info</li>
<li>executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS</li>
<li>copy ib_buffer_pool</li>
<li>completed OK!</li>
</ol>
<p><strong>注意：</strong> 当存在非InnoDB表时，xtrabackup 8.0会执行FTWRL。</p>
</blockquote>
<p>从上述步骤可知，xtrabackup 8.0与2.4的步骤<strong>主要区别</strong>为：</p>
<p>当只存在InnoDB引擎的表时，不再执行FTWRL，而是通过 上述第5步（<code>SELECT server_uuid, local, replication, storage_engines FROM performance_schema.log_status</code> ）来获取LSN、binlog position、GTID 。</p>
<p>手册中对于表 <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/8.0/en/performance-schema-log-status-table.html">log_status</a> 的描述如下：</p>
<blockquote>
<p>The <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/8.0/en/performance-schema-log-status-table.html"><code>log_status</code></a> table provides information that enables an online backup tool to copy the required log files without locking those resources for the duration of the copy process.</p>
<p>When the <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/8.0/en/performance-schema-log-status-table.html"><code>log_status</code></a> table is queried, the server blocks logging and related administrative changes for just long enough to populate the table, then releases the resources. The <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/8.0/en/performance-schema-log-status-table.html"><code>log_status</code></a> table informs the online backup which point it should copy up to in the source’s binary log and <code>gtid_executed</code> record, and the relay log for each replication channel. It also provides relevant information for individual storage engines, such as the last log sequence number (LSN) and the LSN of the last checkpoint taken for the <code>InnoDB</code> storage engine.</p>
</blockquote>
<p>从上述手册描述可知，<code>performance_schema.log_status</code>是MySQL 8.0提供给在线备份工具获取复制信息的表格，查询该表时，mysql server将阻止日志的记录和相关的更改来获取足够的时间以填充该表，然后释放资源。</p>
<p>log_status 表通知在线备份工具当前主库的 binlog 的位点和 gtid_executed 的值以及每个复制通道的 relay log。另外，它还提供了各个存储引擎的相关信息，比如，提供了 InnoDB 引擎使用的最后一个日志序列号（LSN）和最后一个检查点的 LSN。</p>
<p><code>performance_schema.log_status</code>表定义为：</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- Semi-Sync</span></span><br><span class="line">mysql<span class="operator">&gt;</span> <span class="keyword">select</span> <span class="operator">*</span> <span class="keyword">from</span> performance_schema.log_status\G</span><br><span class="line"><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span> <span class="number">1.</span> <span class="type">row</span> <span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span></span><br><span class="line">    SERVER_UUID: <span class="number">6</span>b437e80<span class="operator">-</span>e5d5<span class="number">-11</span>ea<span class="number">-88e3</span><span class="number">-52549922</span>fdbb</span><br><span class="line">          <span class="keyword">LOCAL</span>: &#123;&quot;gtid_executed&quot;: &quot;6b437e80-e5d5-11ea-88e3-52549922fdbb:1-201094&quot;, &quot;binary_log_file&quot;: &quot;mysql-bin.000079&quot;, &quot;binary_log_position&quot;: <span class="number">195</span>&#125;</span><br><span class="line">    REPLICATION: &#123;&quot;channels&quot;: []&#125;</span><br><span class="line">STORAGE_ENGINES: &#123;&quot;InnoDB&quot;: &#123;&quot;LSN&quot;: <span class="number">23711425885</span>, &quot;LSN_checkpoint&quot;: <span class="number">23711425885</span>&#125;&#125;</span><br><span class="line"><span class="number">1</span> <span class="type">row</span> <span class="keyword">in</span> <span class="keyword">set</span> (<span class="number">0.00</span> sec)</span><br><span class="line"></span><br><span class="line"><span class="comment">-- Group Replication</span></span><br><span class="line">mysql<span class="operator">&gt;</span> <span class="keyword">select</span> <span class="operator">*</span> <span class="keyword">from</span> performance_schema.log_status\G</span><br><span class="line"><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span> <span class="number">1.</span> <span class="type">row</span> <span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span></span><br><span class="line">    SERVER_UUID: <span class="number">7</span>bd32480<span class="operator">-</span>e5d5<span class="number">-11</span>ea<span class="number">-8</span>f8a<span class="number">-525499</span>cfbb7d</span><br><span class="line">          <span class="keyword">LOCAL</span>: &#123;&quot;gtid_executed&quot;: &quot;aaaaaaaa-aaaa-aaaa-aaaa-53ab6ea1210a:1-11&quot;, &quot;binary_log_file&quot;: &quot;mysql-bin.000003&quot;, &quot;binary_log_position&quot;: <span class="number">1274</span>&#125;</span><br><span class="line">    REPLICATION: &#123;&quot;channels&quot;: [&#123;&quot;channel_name&quot;: &quot;group_replication_applier&quot;, &quot;relay_log_file&quot;: &quot;mysql-relay-bin-group_replication_applier.000004&quot;, &quot;relay_log_position&quot;: <span class="number">311</span>, &quot;relay_master_log_file&quot;: &quot;&quot;, &quot;exec_master_log_position&quot;: <span class="number">0</span>&#125;, &#123;&quot;channel_name&quot;: &quot;group_replication_recovery&quot;, &quot;relay_log_file&quot;: &quot;mysql-relay-bin-group_replication_recovery.000003&quot;, &quot;relay_log_position&quot;: <span class="number">151</span>, &quot;relay_master_log_file&quot;: &quot;&quot;, &quot;exec_master_log_position&quot;: <span class="number">0</span>&#125;]&#125;</span><br><span class="line">STORAGE_ENGINES: &#123;&quot;InnoDB&quot;: &#123;&quot;LSN&quot;: <span class="number">20257208</span>, &quot;LSN_checkpoint&quot;: <span class="number">20257208</span>&#125;&#125;</span><br><span class="line"><span class="number">1</span> <span class="type">row</span> <span class="keyword">in</span> <span class="keyword">set</span> (<span class="number">0.00</span> sec)</span><br></pre></td></tr></table></figure>

<p><strong>问题2：<code>performance_schema.log_status</code>提供的信息是否准确呢？</strong></p>
<p>当写入压力大时，该表中的binlog position与GTID信息不一致。</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">mysql<span class="operator">&gt;</span> <span class="keyword">select</span> <span class="operator">*</span> <span class="keyword">from</span> performance_schema.log_status\G  <span class="keyword">show</span> master status;</span><br><span class="line"><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span> <span class="number">1.</span> <span class="type">row</span> <span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span><span class="operator">*</span></span><br><span class="line">    SERVER_UUID: <span class="number">6</span>b437e80<span class="operator">-</span>e5d5<span class="number">-11</span>ea<span class="number">-88e3</span><span class="number">-52549922</span>fdbb</span><br><span class="line">          <span class="keyword">LOCAL</span>: &#123;&quot;gtid_executed&quot;: &quot;6b437e80-e5d5-11ea-88e3-52549922fdbb:1-448709&quot;, &quot;binary_log_file&quot;: &quot;mysql-bin.000087&quot;, &quot;binary_log_position&quot;: <span class="number">341265185</span>&#125;</span><br><span class="line">    REPLICATION: &#123;&quot;channels&quot;: []&#125;</span><br><span class="line">STORAGE_ENGINES: &#123;&quot;InnoDB&quot;: &#123;&quot;LSN&quot;: <span class="number">33797305275</span>, &quot;LSN_checkpoint&quot;: <span class="number">33433316246</span>&#125;&#125;</span><br><span class="line"><span class="number">1</span> <span class="type">row</span> <span class="keyword">in</span> <span class="keyword">set</span> (<span class="number">0.11</span> sec)</span><br><span class="line"></span><br><span class="line"><span class="operator">+</span><span class="comment">------------------+-----------+--------------+------------------+-----------------------------------------------+</span></span><br><span class="line"><span class="operator">|</span> File             <span class="operator">|</span> Position  <span class="operator">|</span> Binlog_Do_DB <span class="operator">|</span> Binlog_Ignore_DB <span class="operator">|</span> Executed_Gtid_Set                             <span class="operator">|</span></span><br><span class="line"><span class="operator">+</span><span class="comment">------------------+-----------+--------------+------------------+-----------------------------------------------+</span></span><br><span class="line"><span class="operator">|</span> mysql<span class="operator">-</span>bin<span class="number">.000087</span> <span class="operator">|</span> <span class="number">343317905</span> <span class="operator">|</span>              <span class="operator">|</span>                  <span class="operator">|</span> <span class="number">6</span>b437e80<span class="operator">-</span>e5d5<span class="number">-11</span>ea<span class="number">-88e3</span><span class="number">-52549922</span>fdbb:<span class="number">1</span><span class="number">-448709</span> <span class="operator">|</span></span><br><span class="line"><span class="operator">+</span><span class="comment">------------------+-----------+--------------+------------------+-----------------------------------------------+</span></span><br><span class="line"><span class="number">1</span> <span class="type">row</span> <span class="keyword">in</span> <span class="keyword">set</span> (<span class="number">0.01</span> sec)</span><br></pre></td></tr></table></figure>

<p><strong>问题3：既然log_status中的binlog position不准确，为什么备份恢复后GTID并没有缺失，数据也没问题？</strong></p>
<p>原因是xtrabackup 8.0在第4步<code>FLUSH NO_WRITE_TO_BINLOG BINARY LOGS</code>之后，在第6步<code>copy last binlog file</code>，这样备份恢复出的新实例在启动后不仅会读取 <code>gtid_executed</code> 表，还会读取拷贝的那个binlog文件来更新GTID。</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">$ mysqlbinlog -vv /data/mysql/mysql-bin<span class="variable">.000096</span></span><br><span class="line"><span class="comment">/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/</span>;</span><br><span class="line"><span class="comment">/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/</span>;</span><br><span class="line">DELIMITER <span class="comment">/*!*/</span>;</span><br><span class="line"># at <span class="number">4</span></span><br><span class="line">#<span class="number">200827</span> <span class="number">11</span>:<span class="number">26</span>:<span class="number">47</span> server id <span class="number">575010000</span>  end_log_pos <span class="number">124</span> CRC32 <span class="number">0</span>xb026e372 	Start: binlog v <span class="number">4</span>, server v <span class="number">8</span><span class="variable">.0</span><span class="variable">.19</span>-<span class="number">10</span> created <span class="number">200827</span> <span class="number">11</span>:<span class="number">26</span>:<span class="number">47</span></span><br><span class="line"># Warning: <span class="keyword">this</span> binlog is either in <span class="keyword">use</span> <span class="keyword">or</span> was <span class="keyword">not</span> closed properly.</span><br><span class="line">BINLOG &#x27;</span><br><span class="line"><span class="number">9</span>ydHXw/Q9EUieAAAAHwAAAABAAQAOC4wLjE5LTEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</span><br><span class="line">AAAAAAAAAAAAAAAAAAAAAAAAEwANAAgAAAAABAAEAAAAYAAEGggAAAAICAgCAAAACgoKKioAEjQA</span><br><span class="line">CgFy4yaw</span><br><span class="line">&#x27;<span class="comment">/*!*/</span>;</span><br><span class="line"># at <span class="number">124</span></span><br><span class="line">#<span class="number">200827</span> <span class="number">11</span>:<span class="number">26</span>:<span class="number">47</span> server id <span class="number">575010000</span>  end_log_pos <span class="number">195</span> CRC32 <span class="number">0</span>xad060415 	Previous-GTIDs</span><br><span class="line"># <span class="number">6</span>b437e80-e5d5-<span class="number">11</span>ea-<span class="number">88</span>e3-<span class="number">52549922</span>fdbb:<span class="number">1</span>-<span class="number">465503</span></span><br><span class="line">SET @@SESSION<span class="variable">.GTID_NEXT</span>= &#x27;AUTOMATIC&#x27; <span class="comment">/* added by mysqlbinlog */</span> <span class="comment">/*!*/</span>;</span><br><span class="line">DELIMITER ;</span><br><span class="line"># End of log file</span><br><span class="line"><span class="comment">/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/</span>;</span><br><span class="line"><span class="comment">/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/</span>;</span><br></pre></td></tr></table></figure>

<h3 id="问题定位"><a href="#问题定位" class="headerlink" title="问题定位"></a>问题定位</h3><h4 id="坑一：MySQL-8-0-Semi-Sync-重建问题"><a href="#坑一：MySQL-8-0-Semi-Sync-重建问题" class="headerlink" title="坑一：MySQL 8.0 + Semi-Sync 重建问题"></a>坑一：MySQL 8.0 + Semi-Sync 重建问题</h4><p>xenon原有的重建逻辑是适配于MySQL 5.6、5.7的（重建过程中xenon进程存活），一直无问题：</p>
<blockquote>
<ol>
<li>禁用raft，将xenon状态设为LEARNER ；</li>
<li>如mysql进程存在，则stop mysql；</li>
<li>清空MySQL数据目录；</li>
<li>执行<code>xtrabackup --backup</code>以<code>xbstream</code>方式获取对端数据；</li>
<li>执行<code>xtrabackup --prepare</code>应用redo log；</li>
<li>启动mysql；</li>
<li>执行<code>stop slave; reset slave all</code>；</li>
<li>执行<code>reset master</code>，以<code>xtrabackup_binlog_info</code>文件中的GTID为准设置<code>gtid_purged</code>；</li>
<li>启用raft，将xenon状态设为FOLLOWER或IDLE；</li>
<li>等待xenon自动<code>change master to</code>到主节点。</li>
<li>执行<code>start slave</code>。</li>
</ol>
</blockquote>
<p><strong>问题1：为什么在 MySQL 8.0 + Semi-Sync 组合下会出现 Duplicate entry ？</strong></p>
<p>跟踪重建过程中的general log，发现在第6和第7步中间，也就是设置<code>gtid_purged</code>之前凭空多出了 <code>change master to</code> 和 <code>start slave</code> 操作：</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.817859</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL rpl_semi_sync_master_enabled=OFF</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.818025</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.818143</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL super_read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.818323</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.824449</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     STOP SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.824610</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     CHANGE MASTER TO MASTER_HOST = &#x27;<span class="number">192</span><span class="variable">.168</span><span class="variable">.0</span><span class="variable">.3</span>&#x27;, MASTER_USER = &#x27;qc_repl&#x27;, MASTER_PASSWORD = &lt;secret&gt;, MASTER_PORT = <span class="number">3306</span>, MASTER_AUTO_POSITION = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.833710</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.935973</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     BEGIN</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">22</span><span class="variable">.936084</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     COMMIT <span class="comment">/* implicit, from Xid_log_event */</span></span><br><span class="line">......</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.701711</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     BEGIN</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.701901</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     COMMIT <span class="comment">/* implicit, from Xid_log_event */</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.816571</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL rpl_semi_sync_master_enabled=OFF</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.816886</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.817177</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL super_read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">24</span><span class="variable">.817281</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.039581</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     BEGIN</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.039749</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     COMMIT <span class="comment">/* implicit, from Xid_log_event */</span></span><br><span class="line">......</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.152919</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     BEGIN</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.153082</span>+<span class="number">08</span>:<span class="number">00</span>           <span class="number">10</span> Query     COMMIT <span class="comment">/* implicit, from Xid_log_event */</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.389776</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     STOP SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.392581</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     RESET SLAVE ALL</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.407434</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     RESET MASTER</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.417292</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL gtid_purged=&#x27;<span class="number">6</span>b437e80-e5d5-<span class="number">11</span>ea-<span class="number">88</span>e3-<span class="number">52549922</span>fdbb:<span class="number">1</span>-<span class="number">102610</span></span><br><span class="line">&#x27;</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.419835</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427071</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427178</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL super_read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427271</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL sync_binlog=<span class="number">1000</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427339</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL innodb_flush_log_at_trx_commit=<span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427423</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SHOW SLAVE STATUS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">25</span><span class="variable">.427600</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SHOW MASTER STATUS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.817622</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL rpl_semi_sync_master_enabled=OFF</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.817794</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.817897</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SET GLOBAL super_read_only = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.817988</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.818381</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SHOW SLAVE STATUS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.818570</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     SHOW MASTER STATUS</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.818715</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     STOP SLAVE</span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.818823</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     CHANGE MASTER TO MASTER_HOST = &#x27;<span class="number">192</span><span class="variable">.168</span><span class="variable">.0</span><span class="variable">.3</span>&#x27;, MASTER_USER = &#x27;qc_repl&#x27;, MASTER_PASSWORD = &lt;secret&gt;, MASTER_PORT = <span class="number">3306</span>, MASTER_AUTO_POSITION = <span class="number">1</span></span><br><span class="line"><span class="number">2020</span>-<span class="number">08</span>-<span class="number">24</span>T21:<span class="number">55</span>:<span class="number">26</span><span class="variable">.832164</span>+<span class="number">08</span>:<span class="number">00</span>            <span class="number">8</span> Query     START SLAVE</span><br></pre></td></tr></table></figure>

<p>这就是说在设置gtid_purged之前已经启用复制获取了一部分数据，那么 xtrabackup_binlog_info 中的内容就不再准确，之后设置的GTID与实际数据就不一致，实际的数据比设置的GTID要多，引起主键冲突。</p>
<p><strong>问题2：为什么之前MySQL 5.6、5.7从没遇到过这个问题呢？</strong></p>
<p>测试了很多次，发现在 MySQL 5.6 &amp; 5.7 在<code>set gtid_purged</code> 前执行 <code>change master to &amp; start slave</code> 后会报复制错误 <code>Slave failed to initialize relay log info structure from the repository</code> ，而在<code>reset slave all; reset master、set gtid_purged</code>后再执行 <code>change master to &amp; start slave</code> 就可以正常复制，数据无误。</p>
<p><strong>问题3：xenon中哪块逻辑引起的额外的 change master to 和 start slave ？</strong></p>
<p>问题根源在重建期间 xenon 会设为 LEARNER 角色，而该角色在探测到MySQL Alive后，会 change master 到主节点。正常来说，要等raft状态设为 FOLLOWER 后由 FOLLOWER 的监听线程 change master 到主节点。（代码见 <a target="_blank" rel="noopener" href="https://github.com/radondb/xenon/pull/104">pr104</a> 、<a target="_blank" rel="noopener" href="https://github.com/radondb/xenon/pull/102">pr102</a>  ）</p>
<h4 id="坑二：MySQL-8-0-Group-Replication-重建后无法启动MGR"><a href="#坑二：MySQL-8-0-Group-Replication-重建后无法启动MGR" class="headerlink" title="坑二：MySQL 8.0 + Group-Replication 重建后无法启动MGR"></a>坑二：MySQL 8.0 + Group-Replication 重建后无法启动MGR</h4><p>根据报错信息<code>Slave failed to initialize relay log info structure from the repository</code>看，应该是xtrabackup重建后的数据目录保留了slave复制信息导致的，尝试在启动组复制前执行<code>reset slave或reset slave all</code>即可解决。</p>
<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><blockquote>
<ol>
<li>Xtrabackup 2.4 备份后生成的 <code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息是准确的，但是备份恢复后 <code>show master status</code> 显示的 GTID 是不准确的。</li>
<li>Xtrabackup 8.0 在备份只有 InnoDB 表的实例时，<code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息不一定是准确的，但是备份恢复后 <code>show master status</code> 显示的 GTID 是准确的。</li>
<li>Xtrabackup 8.0 在备份有非 InnoDB 表格的实例时，<code>xtrabackup_binlog_info</code> 文件记录的 GTID 信息是准确的，备份恢复后 <code>show master status</code> 显示的 GTID 也是准确的。</li>
<li>使用 Xtrabackup 8.0 重建集群节点后，无需执行 <code>reset master &amp; set gtid_purged</code> 操作。</li>
<li>使用 Xtrabackup 8.0 重建 Group-Replication 集群节点后，启动组复制前需要先执行<code>reset slave或reset slave all</code>清除slave信息，否则 <code>start group_replication</code> 会失败。</li>
</ol>
</blockquote>
<hr>
<p>欢迎关注我的微信公众号【数据库内核】：分享主流开源数据库和存储引擎相关技术。</p>
<img src="https://dbkernel-1306518848.cos.ap-beijing.myqcloud.com/wechat/my-wechat-official-account.png" width="400" height="400" alt="欢迎关注公众号数据库内核" align="center"/>


<table>
<thead>
<tr>
<th>标题</th>
<th>网址</th>
</tr>
</thead>
<tbody><tr>
<td>GitHub</td>
<td><a href="https://dbkernel.github.io/">https://dbkernel.github.io</a></td>
</tr>
<tr>
<td>知乎</td>
<td><a target="_blank" rel="noopener" href="https://www.zhihu.com/people/dbkernel/posts">https://www.zhihu.com/people/dbkernel/posts</a></td>
</tr>
<tr>
<td>思否（SegmentFault）</td>
<td><a target="_blank" rel="noopener" href="https://segmentfault.com/u/dbkernel">https://segmentfault.com/u/dbkernel</a></td>
</tr>
<tr>
<td>掘金</td>
<td><a target="_blank" rel="noopener" href="https://juejin.im/user/5e9d3ed251882538083fed1f/posts">https://juejin.im/user/5e9d3ed251882538083fed1f/posts</a></td>
</tr>
<tr>
<td>开源中国（oschina）</td>
<td><a target="_blank" rel="noopener" href="https://my.oschina.net/dbkernel">https://my.oschina.net/dbkernel</a></td>
</tr>
<tr>
<td>博客园（cnblogs）</td>
<td><a target="_blank" rel="noopener" href="https://www.cnblogs.com/dbkernel">https://www.cnblogs.com/dbkernel</a></td>
</tr>
</tbody></table>

      
    </div>
    <div class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    
    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="http://dbkernel.github.io/2020/08/27/percona-xtrabackup-2.4-vs-8.0/" title="问题定位 | Peronca Xtrabackup 8.0近日踩坑总结 - xtrabackup 2.4和8.0区别" target="_blank" rel="external">http://dbkernel.github.io/2020/08/27/percona-xtrabackup-2.4-vs-8.0/</a>
    </li>
    
    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN 许可协议</a>，转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://github.com/dbkernel" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="../../../../images/avatar.png" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://github.com/dbkernel" target="_blank"><span class="text-dark">DBKernel</span><small class="ml-1x">资深数据库开发工程师</small></a></h3>
        <div>目前从事云数据库MySQL/PostgreSQL的研发工作，曾做过PGXC、Greenplum等分布式数据库的内核开发。热衷于研究主流数据库架构、源码，对关系型数据库 MySQL/PostgreSQL及分布式数据库有深入研究。</div>
      </div>
    </figure>
  </div>
</div>


    </div>
  </article>
  
    
  <section id="comments">
  	
           
    
  </section>


  
</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">
  
  <ul class="pager pull-left">
    
    <li class="prev">
      <a href="../../28/clickhouse-and-friends-11-mysql-gtid-replication/" title="源码分析 | ClickHouse和他的朋友们（11）MySQL实时复制之GTID模式"><i class="icon icon-angle-left" aria-hidden="true"></i><span>&nbsp;&nbsp;上一篇</span></a>
    </li>
    
    
    <li class="next">
      <a href="../../20/clickhouse-and-friends-10-merge-tree-wal/" title="源码分析 | ClickHouse和他的朋友们（10）MergeTree Write-Ahead Log"><span>下一篇&nbsp;&nbsp;</span><i class="icon icon-angle-right" aria-hidden="true"></i></a>
    </li>
    
    
    <li class="toggle-toc">
      <a class="toggle-btn collapsed" data-toggle="collapse" href="#collapseToc" aria-expanded="false" title="文章目录" role="button">
        <span>[&nbsp;</span><span>文章目录</span>
        <i class="text-collapsed icon icon-anchor"></i>
        <i class="text-in icon icon-close"></i>
        <span>]</span>
      </a>
    </li>
    
  </ul>
  
  
  <!-- Button trigger modal -->
  <button type="button" class="btn btn-fancy btn-donate pop-onhover bg-gradient-warning" data-toggle="modal" data-target="#donateModal"><span>赏</span></button>
  <!-- <div class="wave-icon wave-icon-danger btn-donate" data-toggle="modal" data-target="#donateModal">
    <div class="wave-circle"><span class="icon"><i class="icon icon-bill"></i></span></div>
  </div> -->
  
  
  <div class="bar-right">
    
    <div class="share-component" data-sites="weibo,qq,wechat,qzone,facebook,twitter,linkedin" data-mobile-sites="weibo,qq,wechat,qzone,linkedin"></div>
    
  </div>
  </div>
</nav>
  
<!-- Modal -->
<div class="modal modal-center modal-small modal-xs-full fade" id="donateModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content donate">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <div class="modal-body">
        <div class="donate-box">
          <div class="donate-head">
            <p>感谢您的支持，我会继续努力的!</p>
          </div>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade active in" id="alipay">
              <div class="donate-payimg">
                <img src="../../../../images/donate/alipayimg.png" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开支付宝扫一扫，即可进行扫码打赏哦</p>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="wechatpay">
              <div class="donate-payimg">
                <img src="../../../../images/donate/wechatpayimg.png" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开微信扫一扫，即可进行扫码打赏哦</p>
            </div>
          </div>
          <div class="donate-footer">
            <ul class="nav nav-tabs nav-justified" role="tablist">
              <li role="presentation" class="active">
                <a href="#alipay" id="alipay-tab" role="tab" data-toggle="tab" aria-controls="alipay" aria-expanded="true"><i class="icon icon-alipay"></i> 支付宝</a>
              </li>
              <li role="presentation" class="">
                <a href="#wechatpay" role="tab" id="wechatpay-tab" data-toggle="tab" aria-controls="wechatpay" aria-expanded="false"><i class="icon icon-wepay"></i> 微信支付</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
	
    <ul class="social-links">
    	
        <li><a href="../../../../https:/github.com/dbkernel" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="../../../../atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    <div class="copyright">
    	
        &copy; 2022 DBKernel
        
        <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="../../../../js/plugin.min.js"></script>


<script src="../../../../js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '../../../../content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="../../../../js/insight.js"></script>






   
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





   
    
  <!-- <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css"> -->
  <script src="//cdn.jsdelivr.net/npm/gitalk@1.4.0/dist/gitalk.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js"></script>
  <script type="text/javascript">
  var gitalk = new Gitalk({
    clientID: '642675de9efee853bde8',
    clientSecret: 'e481d901d83ac31b4041437ec30a4fd00d112cfa',
    repo: 'dbkernel/gitalk-comment',
    owner: 'dbkernel',
    admin: ['dbkernel1989'],
    id: md5(location.pathname),
    distractionFreeMode: true
  })
  gitalk.render('comments')
  </script>

      






    <script defer>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?bf7f972e25b6a36ff4b828ba0214e515";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>



</body>
</html>